{function showMenu}
	{foreach $menu as $mName => $mItem}
		{if $mName==''}
			{continue}
		{/if}
		<li>
			<a  {if $pageId==$mitem[''].id}class="active"{/if} href="{$mItem[''].link}">{$mName}</a>
			{if $mItem|count > 1}
				<ul>
					{showMenu menu=$mItem}
				</ul>
			{/if}
		</li>
	{/foreach}
{/function}

<ul id="nav">
	{showMenu menu=$topMenu}
</ul>